package main.java.Thread;

class Thread2 implements Runnable {
    int i = 0;

    @Override
    public void run() {
        while (i < 10){
            try {
                System.out.println("current thread is " + Thread.currentThread().getName());
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }

    }

    public static void main(String[] args) {
        Thread2 t = new Thread2();
        Thread tt = new Thread(t);
        tt.start();
    }
}